package com.relytosoft.mizar.media.camera.services.api.impl;

import com.relytosoft.dubhe.common.core.object.ResponseResult;
import com.relytosoft.mizar.media.camera.api.entity.CameraPlatform;
import com.relytosoft.mizar.media.camera.api.feign.CameraFeignInService;
import com.relytosoft.mizar.media.camera.api.pojo.dto.CameraChannelDto;
import com.relytosoft.mizar.media.camera.api.pojo.vo.CameraBasePlatform;
import com.relytosoft.mizar.media.camera.services.mapper.CameraBaseMapper;
import com.relytosoft.mizar.media.camera.services.mapper.CameraChannelMapper;
import com.relytosoft.mizar.media.camera.services.service.CameraPlatformService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author lj
 * @version 2022/4/20.
 */
@Service
public class CameraFeignInServiceImpl implements CameraFeignInService {

    @Resource
    private CameraPlatformService cameraPlatformService;

    @Resource
    private CameraChannelMapper cameraChannelMapper;

    @Resource
    private CameraBaseMapper cameraBaseMapper;

    @Override
    public ResponseResult<CameraPlatform> findById(Integer id) {
        return ResponseResult.ok(cameraPlatformService.findById(id));
    }

    @Override
    public ResponseResult<List<CameraChannelDto>> selectByIds(List<Integer> channelIds) {
        return ResponseResult.ok(cameraChannelMapper.selectByIds(channelIds));
    }

    @Override
    public ResponseResult<List<CameraBasePlatform>> findCameraCode(String platformName, Integer type) {
        return ResponseResult.ok(cameraBaseMapper.findCameraCode(platformName, type));
    }

}
